<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no,minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <meta name="apple-mobile-web-app-title" content="阿福易购">
    <meta content="telephone=no" name="format-detection" />
    <meta content="email=no" name="format-detection" />
    <!-- uc、qq浏览器 -->
    <meta name="screen-orientation" content="portrait">
    <meta name="full-screen" content="yes">
    <meta name="browsermode" content="application">
    <meta name="x5-orientation" content="portrait">
    <meta name="x5-fullscreen" content="true">
    <meta name="x5-page-mode" content="app">
    <meta name="HandheldFriendly" content="true">
    <meta name="MobileOptimized" content="320">
    <meta name="csrf-token" content="{{ csrf_token() }}" />
    <meta name="keywords" content="{{$SEO['keywords']}}"/>
    <meta name="description" content="{{$SEO['description']}}"/>
    <title>分类_{{$SEO['title']}}</title>
    <link rel="stylesheet" href="{{ asset('/build/css/app.min.css') }}">
</head>
<body ontouchstart="">
@inject('pictureService','App\Interfaces\PictureService')
@inject('adService','App\Interfaces\AdService')
@inject('categoryService','App\Interfaces\CategoryService')
@inject('recommendPositionService','App\Interfaces\RecommendPositionService')
<header class="ui-header ui-header-stable ui-border-b af-header">
    <ul class="ui-row-flex">
        <li class="ui-col ui-flex ui-flex-pack-start">
            <i class="ui-icon-home" data-href="/"></i>
        </li>
        <li class="ui-col ui-flex ui-flex-pack-center">
            <h1>{{$category->cat_name}}</h1>
        </li>
        <li class="ui-col ui-flex ui-flex-pack-end">
            <i class="ui-icon-search" data-href="/search"></i>
        </li>
    </ul>
</header>

<div class="ui-container">
    <section class="J-filter-scroll ui-scroll-menu af-filter-scroller">
        <ul class="ui-scroll-menu-nav" >
            <li data-href="/">全部</li>
            @foreach($categoryService->top() as $cat)
            <li data-href="/cat/{{$cat->cat_id}}" @if($cat->cat_id == $id)class="current"@endif>{{$cat->cat_name}}</li>
            @endforeach
        </ul>
    </section>

    <section class="ui-slider">
        <ul class="ui-slider-content" style="width: 300%">
            <?php
            if(empty($adService->get('cat_focus_'.$category->cat_id))){
            $ads = $adService->get('index_focus');
            }else{
            $ads = $adService->get('cat_focus_'.$category->cat_id);
            }
            //dd($ads);
            ?>
            @if($ads)
            @foreach($ads as $key=>$ad)
            <li class="current"><span style="background-image:url('{{$pictureService::thumb($ad->m_image),1280,500}}')"></span></li>
            @endforeach
            @endif

        </ul>
    </section>

    <section class="ui-hot-cat">
        <h2 class="af-border-b">热门分类</h2>
        <ul class="ui-row">
            @foreach($cats as $k=>$v)
            <li data-href="/cat/{{$categoryService->get($k)->cat_id}}?cat_id={{$categoryService->get($k)->cat_id}}" class="ui-col ui-col-25">
                <div class="ui-grid-trisect-img ui-cat-img">
                    <span style="background-image:url('{{$pictureService::thumb($categoryService->get($k)->cat_picture),400,400}}')"></span>
                </div>
                <div class="ui-cat-info">
                    <h3 class="ui-nowrap">{{$v}}</h3>
                </div>
            </li>
            @endforeach
        </ul>
    </section>

    <section class="ui-hot-cat ui-hot-cat-skin2">
        <h2 class="af-border-b">热门品牌</h2>
        <ul class="ui-row">
            @foreach($recommendBrands as $k=>$v)
            <li data-href="/search/result?brand_id={{$v->brand_id}}" class="ui-col ui-col-25">
                <div class="ui-grid-trisect-img ui-cat-img">
                    <span style="background-image:url('{{$pictureService::thumb($v->brand_logo),280,140}}')"></span>
                </div>
            </li>
            @endforeach

        </ul>
    </section>

    <section class="ui-rec-goods">
        <h2>热门商品</h2>
        <ul id="scrollLoadGoods" data-url="/get_cat_goods?cat_id={{$id}}" class="ui-rec-goods-item">
            @foreach($recommendGoods as $key=>$goods)
            <li @if($key%2==0) class="l" @else class="r" @endif>
                <div class="ui-goods-card">
                    <div data-href="/goods/show/{{$goods->goods_id}}" class="ui-grid-halve-img af-border-b">
                        <span style="background-image:url('{{$pictureService::thumb($goods->goods_thumb),254,254}}')"></span>
                    </div>
                    <div class="ui-goods-info">
                        <h3 data-href="/goods/show/{{$goods->goods_id}}" class="ui-nowrap">{{$goods->goods_name}}</h3>
                        <p><span class="shop-price">{{$goods->shop_price}}</span><del class="market-price">{{$goods->market_pricce}}</del></p>
                    </div>
                </div>
            </li>
            @endforeach
        </ul>
        <div class="ui-loading-wrap">
            <p>正在加载中...</p>
            <i class="ui-loading"></i>
        </div>
    </section>
</div>
<div class="af-page-footer">
    <div class="af-footer-copyright">
        <p>阿福易购版权所有@2015-2016</p>
    </div>
</div>
<script src="{{ asset('/build/lib/zepto.min.js') }}"></script>
<script src="{{ asset('/build/js/frozen.js') }}"></script>
<script src="{{ asset('/build/js/app.min.js') }}"></script>
</body>
</html>